<?php
$lang_fish_stats = trans('view.game.data.settlement.fish_stats');
$lang_fish = trans('view.game.data.settlement.fish');

$fish_stats = $detail['details']['fish_stats'] ?? [];
?>

@extends('games.base')

@section('content')
    @isset($fish_stats)
        <div class="list-space"></div>
        <table>
            <thead class="header">
            <tr>
                <th>#</th>
                <th>{{ $lang_fish_stats['bullet_num'] }}</th>
                <th>{{ $lang_fish_stats['bet'] }}</th>
                <th>{{ $lang_fish_stats['win'] }}</th>
                <th>{{ $lang_fish_stats['kill_num'] }}</th>
            </tr>
            </thead>
            <tbody class="body">
            @foreach ($fish_stats as $item)
                <tr>
                    <td>
                        <div class="call">
                            <img style="height: 40px" src="{{ $domain['client'] }}/assets/fishjackpot/{{ $item['id'] }}.png">
                            <div style="margin-left: 5px">{{ $lang_fish[$item['id']] ?? $item['id'] }}</div>
                        </div>
                    </td>
                    <td>{{ num_format($item['bullet_num']) }}</td>
                    <td>{{ num_format($item['bet']) }}</td>
                    <td>{{ num_format($item['win']) }}</td>
                    <td>{{ num_format($item['kill_num']) }}</td>
                </tr>
            @endforeach
            </tbody>
            <tbody class="footer">
            <tr>
                <td>{{ $lang_fish_stats['sum'] }}</td>
                <td>{{ num_format(array_sum(array_column($fish_stats, 'bullet_num'))) }}</td>
                <td>{{ num_format(array_sum(array_column($fish_stats, 'bet'))) }}</td>
                <td>{{ num_format(array_sum(array_column($fish_stats, 'win'))) }}</td>
                <td>{{ num_format(array_sum(array_column($fish_stats, 'kill_num'))) }}</td>
            </tr>
            </tbody>
        </table>
    @endisset
@endsection
